﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace InterfacesTransformation
{
    public interface IDuplicationRemover
    {
        /// <summary>
        /// The host which manages plugins
        /// </summary>
        IHost PluginHost { get; set; }
        /// <summary>
        /// The name of the plugin
        /// </summary>
        string PluginName { get; }
        /// <summary>
        /// The user control of the plugin
        /// </summary>
        UserControl PluginUserControl { get; }
        /// <summary>
        /// Initialize needed things for the plugin
        /// </summary>
        void Initialize();
        /// <summary>
        /// Dispose the plugin
        /// </summary>
        void PluginDispose();
    
         /// <summary>
        /// Remove duplication in one group
        /// </summary>
        /// <param name=param name="curGroup">Current group of pages</param>
        void RemoveDuplication(List<DTO.Webpage> curGroup);

        /// <summary>
        /// Match two Webtags and compare their children tags
        /// </summary>
        /// <param name="wtag1">The first webtag which will be matched</param>
        /// <param name="wtag2">The second webtag which will be matched</param>
        /// <returns>0 if they have the same structure, -1 if they're different, 1 if they are duplicated</returns>
        int MatchTwoWebtags(DTO.Webtag wtag1, DTO.Webtag wtag2);

        /// <summary>
        /// Measure the similarity between 2 pages.
        /// </summary>
        /// <param name="wtag">MatchTwoWebtags-ed webtag</param>
        /// <returns>The similarity</returns>
        int MeasureSimilarity(DTO.Webtag wtag);
    }
}
